Computing Lowest Common Ancestors in Directed Acyclic Graphs
نویسنده
چکیده
Finding the lowest common ancestor of a given pair of nodes is a fundamental algorithmic problem. In this paper we study the lowest common ancestor(LCA) problem on directed acyclic graphs (DAGs). A lowest common ancestor of two nodes a and b is a node c which is a common ancestor of a and b and no other node is both a common ancestor of a and b and a proper descendant of c. LCA on trees have been studied extensively. LCA on DAGs has also been investigated by several researchers. Many problems that require finding LCA cannot be solved using tree-LCA algorithms because the structure of DAGs are quite different from that of trees. Nykänen and Ukkonen [6] give a linear-time preprocessing, constant-time-query algorithm for the LCA in arbitrarily directed trees. They ask whether it is possible to preprocess a DAG in o(n3) time to support Θ(k)-time set-LCA queries, where a set-LCA query returns all k lowest common ancestors of the given pair. Ait-Kaci et al. [2] considered the problem of LCA on lattices and lower semi-lattices (where a node pair has a unique LCA). Bender et al. gave an algorithm [3] for all-pairs-representative LCA in DAGs in O(n2.688) time. In this paper we show that all-pairs-representative LCA in DAGs can be computed in O(n2.575) time. This time complexity coincides with the current time complexity for computing all-pairs shortest paths for directed unweighted graphs [7]. Research supported in part by NSF grant 0310245.
منابع مشابه
All-Pairs Common-Ancestor Problems in Weighted Dags
This work considers the (lowest) common ancestor problem in weighted directed acyclic graphs. The minimum-weight (lowest) common ancestor of two vertices is the vertex among the set of (lowest) common ancestors with the smallest ancestral distance. For the all-pairs minimum-weight common ancestor problem we present an O(nm) algorithm for arbitrary edge weights which is optimal for sparse graphs...
متن کاملNew common ancestor problems in trees and directed acyclic graphs
We derive a new generalization of lowest common ancestors (LCAs) in dags, called the lowest single common ancestor (LSCA). We show how to preprocess a static dag in linear time such that subsequent LSCA-queries can be answered in constant time. The size is linear in the number of nodes. We also consider a “fuzzy” variant of LSCA that allows to compute a node that is only an LSCA of a given perc...
متن کاملLowest Common Ancestors in Trees and Directed Acyclic Graphs1
We study the problem of finding lowest common ancestors (LCA) in trees and directed acyclic graphs (DAGs). Specifically, we extend the LCA problem to DAGs and study the LCA variants that arise in this general setting. We begin with a clear exposition of Berkman and Vishkin’s simple optimal algorithm for LCA in trees. The ideas presented are not novel theoretical contributions, but they lay the ...
متن کاملLowest common ancestors in trees and directed acyclic graphs
We study the problem of finding lowest common ancestors (LCA) in trees and directed acyclic graphs (DAGs). Specifically, we extend the LCA problem to DAGs and study the LCA variants that arise in this general setting. We begin with a clear exposition of Berkman and Vishkin’s simple optimal algorithm for LCA in trees. Their ideas lay the foundation for our work on LCA problems in DAGs. We presen...
متن کاملImproved Algorithms for the All-pairs Lowest Common Ancestor Problem in Directed Acyclic Graphs
We present a new algorithm for solving the all-pairs lowest common ancestor problem in directed acyclic graphs (dags). Our algorithm runs in time O(n), where λ satisfies the equation ω(1, λ, 1) = 1 + 2λ and ω(1, λ, 1) is the exponent of the multiplication of an n × n matrix by an n × n matrix. By the currently best bounds on ω(1, λ, 1), the running time of our algorithm is O(n). Our algorithm i...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007